package com.example.sy_2;


import javax.servlet.GenericServlet;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

public class ShowLetter extends GenericServlet {
    @Override
    public void service(ServletRequest request, ServletResponse response)
            throws ServletException, IOException {
        // 设置响应内容类型
        response.setContentType("text/html;charset=utf-8");
        PrintWriter out = response.getWriter();

        // 输出 HTML 内容
        out.println("<html><body>");

        // 显示英文大写字母表
        out.print("<br>英文大写字母: ");
        for (char c = 'A'; c <= 'Z'; c++) {
            out.print(c + " ");
        }

        // 显示英文小写字母表
        out.print("<br>英文小写字母: ");
        for (char c = 'a'; c <= 'z'; c++) {
            out.print(c + " ");
        }

        out.println("</body></html>");

        // 关闭输出流
        out.close();
    }
}

